<template>
	<scroll-view scroll-y class="u-page">
		<view class="cu-bar bg-white solid-bottom card_title">
			<view class="action">
				<text class="cuIcon-titles text-blue"></text> 功能模块
			</view>
			<view class="action">
				<button class="cu-btn bg-gradual-blue shadow" @click="resetModule">重置</button>
			</view>
		</view>
		<view class="cu-list menu">
			<view class="cu-item" @click="onSelect('GD')">
				<view class="content">
					<text class="icon-jcszhongdagudongbiangeng iconfont"
						:class="moduleSelect.GD?'text-blue':'text-grey'"
						style="font-size: 36rpx;margin-right: 5px;"></text>
					<text :class="moduleSelect.GD?'text-blue':'text-grey'">股东变更</text>
				</view>
				<view class="action">
					<checkbox class='round blue' :class="moduleSelect.GD?'checked':''"
						:checked="moduleSelect.GD?true:false"></checkbox>
				</view>
			</view>
			<view class="cu-item" @click="onSelect('GG')">
				<view class="content">
					<text class="icon-jcsgaoguanxinxi iconfont" :class="moduleSelect.GG?'text-blue':'text-grey'"
						style="font-size: 36rpx;margin-right: 5px;"></text>
					<text :class="moduleSelect.GG?'text-blue':'text-grey'">高管变更</text>
				</view>
				<view class="action">
					<checkbox class='round blue' :class="moduleSelect.GG?'checked':''"
						:checked="moduleSelect.GG?true:false"></checkbox>
				</view>
			</view>
			<view class="cu-item" @click="onSelect('DZ')">
				<view class="content">
					<text class="icon-jcsdizhi iconfont" :class="moduleSelect.DZ?'text-blue':'text-grey'"
						style="font-size: 36rpx;margin-right: 5px;"></text>
					<text :class="moduleSelect.DZ?'text-blue':'text-grey'">地址变更</text>
				</view>
				<view class="action">
					<checkbox class='round blue' :class="moduleSelect.DZ?'checked':''"
						:checked="moduleSelect.DZ?true:false"></checkbox>
				</view>
			</view>
			<view class="cu-item" @click="onSelect('MC')">
				<view class="content">
					<text class="icon-jcsgetigongshanghumingchengbiangenghezhun iconfont"
						:class="moduleSelect.MC?'text-blue':'text-grey'"
						style="font-size: 36rpx;margin-right: 5px;"></text>
					<text :class="moduleSelect.MC?'text-blue':'text-grey'">名称变更</text>
				</view>
				<view class="action">
					<checkbox class='round blue' :class="moduleSelect.MC?'checked':''"
						:checked="moduleSelect.MC?true:false"></checkbox>
				</view>
			</view>
			<view class="cu-item" @click="onSelect('JY')">
				<view class="content">
					<text class="icon-jcsjingyingfanwei iconfont" :class="moduleSelect.JY?'text-blue':'text-grey'"
						style="font-size: 36rpx;margin-right: 5px;"></text>
					<text :class="moduleSelect.JY?'text-blue':'text-grey'">经营范围</text>
				</view>
				<view class="action">
					<checkbox class='round blue' :class="moduleSelect.JY?'checked':''"
						:checked="moduleSelect.JY?true:false"></checkbox>
				</view>
			</view>
			<view class="cu-item" @click="onSelect('ZC')">
				<view class="content">
					<text class="icon-jcszhuceziben iconfont" :class="moduleSelect.ZC?'text-blue':'text-grey'"
						style="font-size: 36rpx;margin-right: 5px;"></text>
					<text :class="moduleSelect.ZC?'text-blue':'text-grey'">注册资本</text>
				</view>
				<view class="action">
					<checkbox class='round blue' :class="moduleSelect.ZC?'checked':''"
						:checked="moduleSelect.ZC?true:false"></checkbox>
				</view>
			</view>
			<view class="cu-item" @click="onSelect('CZ')">
				<view class="content">
					<text class="icon-jcsshijian iconfont" :class="moduleSelect.CZ?'text-blue':'text-grey'"
						style="font-size: 36rpx;margin-right: 5px;"></text>
					<text :class="moduleSelect.CZ?'text-blue':'text-grey'">出资时间</text>
				</view>
				<view class="action">
					<checkbox class='round blue' :class="moduleSelect.CZ?'checked':''"
						:checked="moduleSelect.CZ?true:false"></checkbox>
				</view>
			</view>
		</view>
		<view class="module-button">
			<u-button @click="submit" type="primary" :disabled="changeFlag">下一步</u-button>
		</view>
	</scroll-view>
</template>

<script>
	export default {
		data() {
			return {
				moduleSelect: {
					"GD": false,
					"GG": false,
					"DZ": false,
					"MC": false,
					"JY": false,
					"ZC": false,
					"CZ": false
				},
				changeFlag: true
			}
		},
		onReady() {

		},
		methods: {
			onSelect(type) {
				// todo 互斥校验
				this.moduleSelect[type] = !this.moduleSelect[type];
				this.changeFlag=false;
			},
			resetModule() {
				this.moduleSelect = {
					"GD": false,
					"GG": false,
					"DZ": false,
					"MC": false,
					"JY": false,
					"ZC": false,
					"CZ": false
				}
			},
			submit() {
				let params = [];
				for(let key  in this.moduleSelect){
					if(this.moduleSelect[key]){
						params.push(key);
					}
				}
				uni.navigateTo({
					url: "../change/goChange?type="+params
				});
			}
		}
	}
</script>

<style>
	.module-button {
		position: fixed;
		z-index: 9999;
		bottom: 0;
		width: 100%;
	}

	.module-button u-button button {
		border-radius: 0rpx;
	}
</style>
